﻿using System;
using System.ComponentModel;
using System.Runtime.InteropServices;

namespace Teigha.Core
{
	public class OdGsBlockRefNodeDesc : OdGsBlockRefNodeDescMem
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public OdGsBlockRefNodeDesc(IntPtr cPtr, bool cMemoryOwn) : base(GlobalsPINVOKE.OdGsBlockRefNodeDesc_SWIGUpcast(cPtr), cMemoryOwn)
		{
			this.swigCPtr = new HandleRef(this, cPtr);
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static HandleRef getCPtr(OdGsBlockRefNodeDesc obj)
		{
			if (obj != null)
			{
				return obj.swigCPtr;
			}
			return new HandleRef(null, IntPtr.Zero);
		}

		~OdGsBlockRefNodeDesc()
		{
			this.Dispose();
		}

		public override void Dispose()
		{
			if (this.swigCPtr.Handle != IntPtr.Zero)
			{
				if (this.swigCMemOwn)
				{
					lock (this.locker)
					{
						if (this.swigCPtr.Handle != IntPtr.Zero && this.swigCMemOwn)
						{
							this.swigCMemOwn = false;
							GlobalsPINVOKE.delete_OdGsBlockRefNodeDesc(this.swigCPtr);
						}
					}
					this.swigCMemOwn = false;
				}
				this.swigCPtr = new HandleRef(null, IntPtr.Zero);
			}
			GC.SuppressFinalize(this);
			base.Dispose();
		}

		public OdGsBlockRefNodeDesc(OdDbStub layoutBlockId, OdGiSubEntityTraitsData tr, OdGeScale3d scale, bool bUsePlotStyles, SWIGTYPE_p_OdGiAnnoScaleSet annoScales) : this(GlobalsPINVOKE.new_OdGsBlockRefNodeDesc__SWIG_0(OdDbStub.getCPtr(layoutBlockId), OdGiSubEntityTraitsData.getCPtr(tr), OdGeScale3d.getCPtr(scale), bUsePlotStyles, SWIGTYPE_p_OdGiAnnoScaleSet.getCPtr(annoScales)), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGsBlockRefNodeDesc(OdGsBlockRefNodeDesc c) : this(GlobalsPINVOKE.new_OdGsBlockRefNodeDesc__SWIG_1(OdGsBlockRefNodeDesc.getCPtr(c)), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGsBlockRefNodeDesc() : this(GlobalsPINVOKE.new_OdGsBlockRefNodeDesc__SWIG_2(), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public SWIGTYPE_p_OdGiAnnoScaleSet m_annoScales
		{
			get
			{
				IntPtr intPtr = GlobalsPINVOKE.OdGsBlockRefNodeDesc_m_annoScales_get(this.swigCPtr);
				SWIGTYPE_p_OdGiAnnoScaleSet result = (intPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_OdGiAnnoScaleSet(intPtr, false);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
				return result;
			}
			set
			{
				GlobalsPINVOKE.OdGsBlockRefNodeDesc_m_annoScales_set(this.swigCPtr, SWIGTYPE_p_OdGiAnnoScaleSet.getCPtr(value));
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
			}
		}

		private object locker = new object();

		private HandleRef swigCPtr;
	}
}
